package com.lagou.advise;

import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @program: spring_aop
 * @description:
 * @author: Mr.Wang
 * @create: 2020-12-16 18:30
 **/
@Component
@Aspect
public class MyAdvise {
	@Pointcut("execution(* com.lagou.service.impl.AccountServiceImpl.*(..))")
	public void mypoint(){

	}

	@Before("MyAdvise.mypoint()")
	public void before(){
		System.out.println("前置方法执行");
	}
	@AfterReturning("MyAdvise.mypoint()")
	public void afterReturning(){
		System.out.println("后置方法执行了");
	}

	public void after(){
		System.out.println("最终方法执行了");
	}

	public void throwing(){
		System.out.println("异常方法执行了");
	}
}
